package com.haiyou.dc.mq.controller;

import com.haiyou.common.util.R;
import com.haiyou.dc.mq.bi.RabbitMqService;
import com.haiyou.dc.mq.vo.LogVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Date;

/**
 * @author pc
 */
@RestController
@RequestMapping("/log")
public class LogMqController {

    @Autowired
    private RabbitMqService rabbitMqService;

    @GetMapping("/senLogMessage")
    public R sendLogMessage(){

        LogVo logVo = new LogVo();
        logVo.setLevel("info");
        logVo.setMessage("测试info消息");
        logVo.setDate(new Date());
        rabbitMqService.sendLogMessage(logVo);


        return R.ok();
    }
}
